<?php
	include_once("Login.php");
	
	$conn = new mysqli($host,$user,$passwd, $database)
	or die("SQL connect error: ".mysqli_connect_error());
	
	$body = file_get_contents('php://input');
	$xml = simplexml_load_string($body);

	$id = $xml->cloudId;
	$lon = $xml->lon;
	$lat = $xml->lat;
	$query = "INSERT INTO Places (CloudId, Place, Lon, Lat, IsCurrentLocation) VALUES ('$id', 'CurrentLocation', '$lon', '$lat', 1)";
	
	mysqli_query($conn, $query);
	
	$id =  mysqli_insert_id($conn);
		
			echo "<node><insertId>$id</insertId></node>";
		
	mysqli_close($conn);
?>